#pragma once

#include "SipGDService.hpp"
#include "SipEveryHandler.h"

#include "DatabaseAdaptor.h"

using namespace wtsip;

class CResipTesterDlg;
class wtsip::CSipInviteSession;
class wtsip::CIvsMessage;

class CServiceListener :
    public CSipGDServiceListener
{
public:
    CServiceListener(CSipGDService& sv, CResipTesterDlg& dlg);

    ~CServiceListener(void);

    ///////////// Dialog Listener  ///////////////////////////

    virtual bool onRealPlay(CSipInviteSession& inv, SipMessage& msg);

    //virtual bool onPTZControl(CSipInviteSession& inv, SipMessage& msg);

    virtual bool onRegister(CSipRegisterSession& reg, SipMessage& msg);

    virtual bool onSubscribe(CSipSubscribeSession2& sub, SipMessage& msg);

    //virtual bool onNotify(CSipSubscribeSession2& sub, SipMessage& msg);

    //////////// Transaction Listener  ////////////////////////

    virtual bool onDevInfo(CSipSessionBase& s, SipMessage& msg);

    virtual bool onStoreAlarm(CSipSessionBase& s, SipMessage& msg);    

    virtual bool onDevCheck(CSipSessionBase& s, SipMessage& msg);

    virtual bool onEncodeSet(CSipSessionBase& s, SipMessage& msg);

    virtual bool onFileListRequest(CSipSessionBase& s, SipMessage& msg);

    virtual bool onFileUrlRequest(CSipSessionBase& s, SipMessage& msg);

    virtual bool onRecordPlanSet(CSipSessionBase& s, SipMessage& msg);

    virtual bool onRecordPlanList(CSipSessionBase& s, SipMessage& msg);

    virtual bool onRecordAction(CSipSessionBase& s, SipMessage& msg);

    virtual bool onTimeSet(CSipSessionBase& s, SipMessage& msg);

    virtual bool onTimeGet(CSipSessionBase& s, SipMessage& msg);

private:

    CResipTesterDlg& m_dlg;

    CSipGDService& m_service;

    //CDatabaseAdaptor m_dbAdaptor;

    //CSipRealPlayHandler m_realhandle;
};
